package cn.appsys.config;

import cn.appsys.controller.developer.AppController;
import cn.appsys.controller.developer.AppController;
import cn.appsys.tools.Constants;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    //保存上传文件的目录
//配置静态资源的Web访问路径，例如上传的文件，将保存在D:/web/upload目录下， //访问的路径则为 /yyyhttp://localhost: xxxy/upload/xxx
// http://localhost:8080/upload/photo/abc.jpg
//
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/upload/photo/**") .addResourceLocations("file:///"+
                Constants.UPLOADED_FOLDER); }
}
